﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Food
{
	class Week
	{
		public static DateTime GetMondayDate(DateTime weekDate)
		{
			DateTime t = weekDate;

			while (t.DayOfWeek != DayOfWeek.Monday)
			{
				t = t.Subtract(TimeSpan.FromDays(1));
			}

			return t;
		}

		public DateTime MondayDate
		{
			get ;

			set ;
		}

		public string FolderName
		{
			get
			{
				return MondayDate.Year.ToString() + "." + MondayDate.Month.ToString("D2") + "." + MondayDate.Day.ToString("D2");
			}
		}

		public Week(DateTime weekDate)
		{
			MondayDate = GetMondayDate(weekDate);

		}
	}
}
